<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
    <title>Customize Package</title>
</h:head>
<h:form>
    <p:menubar>  
    <p:menuitem value="Home" url="home.xhtml" />  
        <p:submenu label="Package Section" >  
            <p:menuitem value="All Packages" url="package.xhtml" />  
        </p:submenu>  
  
        <p:submenu label="Gift List" >  
            <p:menuitem value="My Gift List" url="giftList.xhtml" />    
        </p:submenu> 
  
       <f:facet name="options">   
       		<p:commandButton value="Edit Profile" action="profileEdit.xhtml"/>
            <p:commandButton value="Logout" action="#{LoginManaged.logout()}" icon="ui-icon-close" />
       </f:facet>
    </p:menubar>  
</h:form>
<h:form>  
  
    <p:growl id="growl" sticky="true" showDetail="true"/>  
  
    <p:wizard flowListener="#{PackageCM.onFlowProcess}">  
      
		<p:tab id="going" title="Going">  
            <p:panel header="Going">  
                <h:messages errorClass="error"/>      
                <p:selectOneListbox value="#{PackageCM.selectedG}"  style="width:100%;" required="true" >
   					<f:selectItems value="#{PackageCM.gDTO}" var="g" itemLabel="#{g.departurePlace} -> #{g.arrivalPlace} : #{g.departureDate} - #{g.arrivalDate}" itemValue="#{g.id}" />
   				</p:selectOneListbox>
            </p:panel>  
        </p:tab>  
              
        <p:tab id="return" title="Return">  
            <p:panel header="Return">  
                <h:messages errorClass="error"/>  
              <p:selectOneListbox value="#{PackageCM.selectedR}" style="width:100%;" required="true">
   					<f:selectItems value="#{PackageCM.rDTO}" var="r" itemLabel="#{r.departurePlace} -> #{r.arrivalPlace} : #{r.departureDate} - #{r.arrivalDate}" itemValue="#{r.id}" />
   				</p:selectOneListbox>
            </p:panel>  
        </p:tab>  
              
        <p:tab id="hotel" title="Hotel">  
            <p:panel header="Hotels">  
                <h:messages errorClass="error"/>      
                <p:selectOneListbox value="#{PackageCM.selectedH}" style="width:100%;" required="true">
   					<f:selectItems value="#{PackageCM.hDTO}" var="h" itemLabel="#{h.name} - #{h.price}" itemValue="#{h.id}" />
   				</p:selectOneListbox>
            </p:panel>  
        </p:tab>  
        
         <p:tab id="excursion" title="Excursion">  
            <p:panel header="Excursion">  
                <h:messages errorClass="error"/>  
              <p:selectOneListbox value="#{PackageCM.selectedE}" style="width:100%;" >
   					<f:selectItems value="#{PackageCM.eDTO}" var="e" itemLabel="#{e.name}" itemValue="#{e.id}" />
   				</p:selectOneListbox>
   			
            </p:panel>  
        </p:tab>  
        
        <p:tab id="fine" title="Confirm">  
            <p:panel header="Confirm">  
                <h:messages errorClass="error"/>  

   				
   				<p:commandButton value="Create" action="#{PackagePM.buycustomize(PackageCM.pDTO)}" ajax="false" />
				<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" /> 
            </p:panel>  
        </p:tab>  
          
    </p:wizard>  
</h:form>  

</html>